/**
 * Created by lenovo on 19/6/5 005.
 */


// 导航
var toTop = document.querySelector("#toTop");
var to = document.querySelector("#to");
var item =document.querySelector("#item");
window.onscroll = function(){
    console.log(document.body.scrollTop);
    if(document.documentElement.scrollTop > 100 || document.body.scrollTop > 100){
        toTop.style.position ="fixed";
        toTop.style.top ="110px";
        to.style.position ="fixed";
        to.style.top ="0";
        if (document.documentElement.scrollTop > 1200 || document.body.scrollTop > 1200){
            item.classList.remove("hide");
        }else {
            item.classList.add("hide");
        }
    }else {
        toTop.style.position ="relative";
        toTop.style.top ="0";
        to.style.position ="relative";
        to.style.top ="0";
        to.style.transition = "5s";
    }
};
